{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "c8717d3c",
   "metadata": {},
   "source": [
    "# Onekey CNN based Patch Recognition\n",
    "\n",
    "The implemented CNN-based model demonstrates significant advancements in the identification of predictive patches within image data, surpassing traditional methods in both accuracy and efficiency. Unlike conventional algorithms that rely on manually crafted features, which are often labor-intensive and require specialized expertise, CNNs autonomously learn hierarchical spatial features directly from the input data. This capability allows the model to adaptively capture complex patterns inherent in the images, leading to superior generalization across diverse datasets.\n",
    "\n",
    "Key advantages of this CNN model include:\n",
    "\n",
    "1. **Enhanced Predictive Accuracy**: The model achieves an impressive AUC of 0.98, indicating near-perfect performance in distinguishing between predictive and non-predictive patches. This highlights its efficacy in the target identification task.\n",
    "\n",
    "2. **Automatic Feature Extraction**: The CNN model's ability to learn and extract features autonomously from the data eliminates the need for manual feature engineering, thereby enhancing flexibility and reducing reliance on expert input.\n",
    "\n",
    "3. **Scalability and Robustness**: The model benefits from the extensive dataset used for training, which includes 500,000 predictive patches and an equal number of non-predictive regions. The large data volume ensures the model's robustness, mitigates the risk of overfitting, and enhances its capacity to generalize across varied and unseen data.\n",
    "\n",
    "These attributes collectively make the CNN model a powerful and efficient tool for predictive patch identification, offering significant improvements in performance and reliability compared to traditional methodologies.\n",
    "\n",
    "[1]. OnekeyAI-Platform. (2024). Onekey (Version 4.8.18). GitHub repository. https://github.com/OnekeyAI-Platform/onekey"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c961c83c",
   "metadata": {},
   "outputs": [],
   "source": [
    "## 获得视频教程\n",
    "from onekey_algo.custom.Manager import onekey_show\n",
    "onekey_show('CNN-patch2predict')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7e647f56",
   "metadata": {},
   "outputs": [],
   "source": [
    "from onekey_algo.mietb.patch_preprocess import patch2predict\n",
    "\n",
    "sample_dir = r'你自己的patch目录'\n",
    "patch2predict(sample_dir)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9bc64d44",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
